﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Security.Cryptography;
using System.IO;
using System.Diagnostics;
using System.Globalization;

namespace SoftwareLicensing
{
    public partial class MainForm : Form
    {
        public MainForm()
        {
            InitializeComponent();
            
            LicenseKeyHelper m = new LicenseKeyHelper();
            
            Dictionary<string, string> dict = new Dictionary<string, string>();
            LicenseKeyInfo lInfo = new LicenseKeyInfo();
            for (int i = 0; i < 1000; i++)
            {
                string newKey = m.CreateLicenseKey(lInfo);
                LicenseKeyInfo parsedLicenseInfo = m.ParseLicenseKey(newKey);
                Debug.Assert(parsedLicenseInfo.ExpiryTimeUtc == lInfo.ExpiryTimeUtc);
                Debug.Assert(parsedLicenseInfo.AllowedInstallations == lInfo.AllowedInstallations);
                Debug.Assert(parsedLicenseInfo.ProductType == lInfo.ProductType);
                Debug.Assert(parsedLicenseInfo.Features == lInfo.Features);
                dict.Add(newKey, newKey);
            }

            MessageBox.Show("Success");
        }

    }

   
 
}
